package com.spring.config.system.properties;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * ClassName: SpringConfigProperty
 * Desc:
 * Date： 2017/5/9
 * Created：shaom
 */
@Component
public class SpringConfigProperty {

    @Value("${user.name}")
    private String name;//注入配置文件
    @Value("${user.pwd}")
    private String pwd;
    @Value("this is str")
    private String str;//注入字符串
    @Value("#{systemProperties['os.name']}")
    private String osName;//注入操作系统信息
    @Value("#{ T(java.lang.Math).random()}")
    private double randomNum;//注入表达式结果
    @Value("#{databaseConfig.jdbcDriver}")
    private String jdbcDriver;//注入其他Bean的属性


    public String getName() {
        return name;
    }


    public String getPwd() {
        return pwd;
    }


    public String getStr() {
        return str;
    }


    public String getOsName() {
        return osName;
    }


    public double getRandomNum() {
        return randomNum;
    }

    public String getJdbcDriver() {
        return jdbcDriver;
    }
}
